11 Lecture

CS504

Midterm & Final Term Short Notes

Software Design

Software design is the meticulous process of conceptualizing, planning, and organizing the architecture, structure, and functionality of a software system. It involves thoughtful consideration of user requirements, efficient algorithms, scalable


Important Mcq's
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. Which of the following is NOT a software design principle? a) Encapsulation b) Abstraction c) Polymorphism d) Inheritance Solution: c) Polymorphism Which design pattern is used to decouple objects and promote loose coupling? a) Observer b) Singleton c) Factory d) Prototype Solution: a) Observer Which software design principle states that software entities should have only one reason to change? a) Single Responsibility Principle (SRP) b) Open-Closed Principle (OCP) c) Liskov Substitution Principle (LSP) d) Interface Segregation Principle (ISP) Solution: a) Single Responsibility Principle (SRP) Which design pattern is used to create objects without specifying their exact class? a) Adapter b) Prototype c) Builder d) Abstract Factory Solution: b) Prototype Which design principle promotes the idea of coding to an interface rather than an implementation? a) Dependency Inversion Principle (DIP) b) Interface Segregation Principle (ISP) c) Liskov Substitution Principle (LSP) d) Open-Closed Principle (OCP) Solution: b) Interface Segregation Principle (ISP) Which design pattern is used to provide a simple interface to a complex subsystem? a) Facade b) Decorator c) Proxy d) Composite Solution: a) Facade Which design principle suggests that classes should be open for extension but closed for modification? a) Interface Segregation Principle (ISP) b) Liskov Substitution Principle (LSP) c) Single Responsibility Principle (SRP) d) Open-Closed Principle (OCP) Solution: d) Open-Closed Principle (OCP) Which design pattern is used to encapsulate the creation of an object into a single function call? a) Singleton b) Abstract Factory c) Builder d) Factory Method Solution: d) Factory Method Which software design principle suggests that high-level modules should not depend on low-level modules but both should depend on abstractions? a) Dependency Inversion Principle (DIP) b) Liskov Substitution Principle (LSP) c) Interface Segregation Principle (ISP) d) Single Responsibility Principle (SRP) Solution: a) Dependency Inversion Principle (DIP) Which design pattern is used to encapsulate a request as an object, thereby allowing users to parameterize clients with queues, requests, and operations? a) Iterator b) Command c) Strategy d) Memento Solution: b) Command



Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is the difference between cohesion and coupling in software design? Answer: Cohesion refers to the degree of relatedness within a module, indicating how closely the responsibilities of the module are aligned. Coupling, on the other hand, measures the degree of interdependence between modules. High cohesion and low coupling are desirable design qualities. Explain the SOLID principles of software design. Answer: SOLID is an acronym representing five design principles: Single Responsibility Principle (SRP), Open-Closed Principle (OCP), Liskov Substitution Principle (LSP), Interface Segregation Principle (ISP), and Dependency Inversion Principle (DIP). These principles guide software design to achieve modularity, maintainability, and extensibility. What is the purpose of design patterns in software development? Answer: Design patterns provide proven solutions to recurring design problems in software development. They promote reusable and modular designs, improve code maintainability, and facilitate communication among developers by providing a common vocabulary for discussing design concepts. What is the difference between the factory method and abstract factory design patterns? Answer: The factory method pattern defines an interface for creating objects, but allows subclasses to decide which class to instantiate. In contrast, the abstract factory pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes. What are the advantages of using the Model-View-Controller (MVC) architectural pattern? Answer: MVC promotes separation of concerns by dividing an application into three components: the model (data and business logic), the view (user interface), and the controller (handles user input and coordinates model-view interaction). Benefits include modularity, code reusability, and ease of maintenance. Explain the concept of loose coupling in software design. Answer: Loose coupling refers to reducing dependencies between software components. It allows changes in one component to have minimal impact on others, making the system more flexible and maintainable. Loose coupling is achieved through well-defined interfaces and dependency injection. What is the purpose of the decorator design pattern? Answer: The decorator pattern allows behavior to be added dynamically to an object at runtime by wrapping it in a decorator class. This pattern provides a flexible alternative to subclassing for extending the functionality of individual objects without modifying their original classes. Describe the concept of inversion of control (IoC) in software design. Answer: Inversion of Control refers to the shift of control from application code to a framework or container. Instead of instantiating and managing dependencies directly, IoC containers handle the creation and injection of dependencies, promoting loose coupling and modular design. What is the role of the architect in software design? Answer: The architect is responsible for designing the overall structure and behavior of a software system. They make high-level design decisions, define architectural patterns, choose appropriate technologies, and ensure that the system meets functional and non-functional requirements. What are the key considerations when designing for scalability in software systems? Answer: When designing for scalability, considerations include distributed architecture, horizontal scaling, efficient resource utilization, load balancing, caching strategies, and the ability to handle increasing volumes of data and users while maintaining performance and reliability.

Software design is a crucial aspect of software development that focuses on creating an efficient, reliable, and maintainable software system. It involves making high-level architectural decisions, defining module structures, and designing the overall behavior of the system. One of the primary goals of software design is to ensure that the system meets the functional and non-functional requirements specified by the stakeholders. This involves understanding the problem domain, analyzing user needs, and translating them into a well-defined software solution. During the software design process, various design principles and patterns are applied to achieve desirable qualities such as modularity, reusability, and scalability. Design principles like SOLID (Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion) provide guidelines for creating robust and flexible software architectures. Architectural patterns such as Model-View-Controller (MVC), layered architecture, and microservices architecture help in organizing the components of the system and establishing clear separation of concerns. Design patterns like Factory Method, Singleton, Observer, and Decorator provide reusable solutions to common design problems, promoting code maintainability and extensibility. Design decisions also consider performance optimization, error handling, security, and user experience to ensure the overall quality of the software system. Throughout the software design process, collaboration and communication among the development team are essential. Design reviews, documentation, and prototyping are employed to validate and refine the design before implementation. Software design is an iterative process, and feedback from testing, user feedback, and changing requirements influences design decisions. Design tools, modeling languages, and software design methodologies, such as Unified Modeling Language (UML), are often employed to visualize and communicate the design. Overall, software design is a critical phase that lays the foundation for a successful software development project. Well-designed software systems not only meet the current needs but also allow for future enhancements, maintainability, and scalability.